<?php

$id = $_GET['id'];

$re = selectAll('newscate',"pid=$id");
//print_r($re) ;
//die;
if(!empty($re))
{
	echo '不允许删除有子集的分类';
	header('Refresh:1;index.php?a=admin&b=newscate&c=index');
	die;	
}else
{
	$result = delete('newscate', $id);
	if($result>=0)
	{
		echo '删除成功';
		header('Refresh:1;index.php?a=admin&b=newscate&c=index');
		die;
	}else
	{
		echo '删除失败';
		header('Refresh:1;index.php?a=admin&b=newscate&c=index');
		die;	
	}
}


?>